package com.qf.day04;
/**
 * 拷贝数组的方法，把原数组中的内容拷贝到新数组中
 * @param arr1 原数组
 * @param arr2 新数组
 */


public class arr {
    public static void main(String[] args) {
        int [] arr1 = {1,5,8,10,6};
        int [] arr2 = new int[arr1.length];
        copyArr(arr1,arr2);
    }

    public static void copyArr(int[] arr1,int[] arr2){
        for (int i = 0; i < arr1.length; i++) {
            arr2[i] = arr1[i];
//            System.out.print(arr1[i]);

            System.out.print(arr2[i]+" ");

        }
    }



}
